home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
BARNET
/
FREENET
/
DEVOS
/
FDSOURCE.ARC
/
h
/
menu
< prev
next >
Wrap
Text File
|
1996-03-11
|
3KB
|
107 lines
/* menu.h
* Datatypes, definitions and functions for creating menu's and menu-item lists
*/
#ifndef MENU_H
#define MENU_H
#include "OS:territory.h"
#include "OS:wimp.h"
typedef struct list_s list_t;
typedef struct nlist_s
{
char *name;
void *data;
list_t *sub;
struct nlist_s *next;
} nlist_t;
struct list_s
{
int n, s, max;
bool updated;
nlist_t *first, *last;
};
extern wimp_menu *menu,
*provider_m, *provider_h,
*country_m, *country_h,
*phone_m, *phone_h,
*script_m, *script_h,
*login_m, *login_h,
*modem_m, *modem_h,
*stack_m, *stack_h,
*driver_m, *driver_h,
*baud_m, *baud_h,
*delay_m, *delay_h;
#define cistrcmp(s1, s2) territory_collate(territory_CURRENT, (s1), (s2), territory_IGNORE_CASE | territory_IGNORE_ACCENT)
#define menu_INFO 0
#define menu_QUIT 1
#define menu_ADD_WRITE 1
#define menu_TITLE_INDIRECTED 2
#define menu_DONT_TICK 4
#define menu_EXACT_TICK 8
/* Auto */
#ifndef MEMCHECK
extern void *xmalloc(size_t s);
#else
#define xmalloc(s) check_alloc(s, __FILE__, __LINE__, 0)
#endif
extern char *strdup(const char *s)
;
extern char *makepath(const char *s, ...)
;
extern list_t *new_list(void)
;
extern nlist_t *add_link(list_t *list, const char *s)
/* Add string 's' in new element on linked list 'list'
* Return pointer to new element
*/
;
extern list_t *file_list(const char *path, bool recurse)
/* Create and return a linked list of filenames in the given path
* Recurse into dirs (lists) if recurse
*/
;
extern wimp_menu *list_menu(const list_t *list, const wimp_menu *header, int h, const char *tickme, int flags)
/* Create a menu from the linked list of strings fiven by list;
* header points to the title definition and possibly h initialising entries.
* When 'tickme' is in the list of items, tick it, else (or tickme==NULL) tick first item
* Returns: NULL when list and header are empty
* ptr to menu structure otherwise
*/
;
extern wimp_menu_entry *ticked(wimp_menu *m)
/* Return pointer to first ticked menu entry
* or NULL when none are ticked
*/
;
extern void tickonly(wimp_menu *m, int item)
;
extern wimp_menu_entry *stickonly(wimp_menu *m, const char *s)
/* Tick entry s and return pointer to ticked menu entry
*/
;
extern void free_list(list_t *list)
;
extern nlist_t *list_search(const list_t *list, const char *s)
/* Return pointer to first list elm which contains string 's' in its name field
*/
;
extern list_t *load_list(const char *s)
;
extern void save_list(list_t *list, const char *s)
;
extern void list_del(list_t *list, nlist_t *elm)
;
extern void shade_entry(wimp_menu *m, int item, bool shade)
;
#endif